<template>
  <div>
    <el-dialog
      title="本轮报价信息"
      :visible.sync="visible"
      width="50%"
      :before-close="cancel"
      append-to-body
    >
      <div class="dialog-content">
        <el-timeline style="margin:5px">
          <el-timeline-item
            v-for="record in records"
            :key="record.id"
            :timestamp="record.bidTime"
          >
            {{ record.supplier }} 出价：{{ record.price
            }}{{ record.bidUnit }} 可供：{{ record.tenderProvide
            }}{{ record.bidUnit.replace("元/", "") }}
          </el-timeline-item>
        </el-timeline>
      </div>
    </el-dialog>
  </div>
</template>

<script>
export default {
  props: {
    visible: {
      type: Boolean,
      default: false,
    },
    // eslint-disable-next-line vue/require-default-prop
    records: {
      type: Array,
    },
  },

  methods: {
    cancel() {
      this.$emit("cancel");
    },
  },
};
</script>

<style lang="scss" scoped>
.dialog-content {
  height: 300px;
  overflow: auto;
}
</style>
